<?php
// File Security Check
if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) :
	die ( 'You do not have sufficient permissions to access this page!' );
endif;

/* Template Name: Contact Inverted  */

add_filter( 'nice_load_contact_js', '__return_true', 10 );

get_header(); ?>

<?php get_template_part( 'page-title' ); ?>

<!-- BEGIN #container -->
<div id="container" class="clearfix">

    <!-- BEGIN #sidebar -->
    <aside id="sidebar-inverted" role="complementary">

        <?php if ( has_post_thumbnail() ) : ?>
            <figure>
                <?php nice_image( array( 'width' => 480, 'height' => 755, 'class' => 'wp-post-image' ) ); ?>
            </figure>
        <?php endif; ?>

        <?php
            $nice_address = get_option( 'nice_address' );
            $nice_phone_number = get_option( 'nice_phone_number' );
            $nice_email = get_option( 'nice_email' );
            if ( ! empty ( $nice_address ) ) : ?>
                <div class="box">
                        <header>
                                <h3 ><?php bloginfo( 'name' ); ?></h3>
                        </header>
                        <?php echo nl2br ( $nice_address ); ?>
                        <p>
                                <?php if ( $nice_phone_number != '' ) : ?>
                                        <?php printf( __( 'Phone: %s', 'nicethemes' ), $nice_phone_number ); ?>
                                <?php endif; ?>
                        </p>
                </div>
        <?php endif; ?>
    <!-- END #sidebar -->
    </aside>
    
    
    <!-- BEGIN #content -->
    <section id="content-inverted" class="<?php echo $post->post_name; ?>">

    <?php if ( have_posts() ) : ?>

	<?php while ( have_posts() ) : the_post(); ?>

            <article class="post">

                <?php $nice_google_map = get_option( 'nice_google_map' );
                        if ( ! empty ( $nice_google_map ) ) :
                        echo nice_embed( array ( 'embed' => $nice_google_map, 'width' => '100%', 'height' => 342, 'class' => 'nice-contact-map' ) );
                        endif;

                ?>

                <div class="entry">
                        <?php the_content( __( 'Continue reading', 'nicethemes' ) . ' &raquo;' ); ?>
                </div>

                <div class="nice-contact-form clearfix">

                        <form name="nice_contact" id="nice_contact" method="post" >
                                <p>
                                        <label for="name" form="nice_contact"><?php _e( 'Your Name', 'nicethemes' ); ?><span class="required">*</span></label>
                                        <input type="text" id="name" name="name" value="" class="required" />
                                </p>
                                <p>
                                        <label for="subject" form="nice_contact"><?php _e( 'Subject', 'nicethemes' ); ?></label>
                                        <input type="text" name="subject" id="subject" value="" />
                                </p>
                                <p>
                                        <label for="mail" form="nice_contact"><?php _e( 'Your E-Mail', 'nicethemes' ); ?><span class="required">*</span></label>
                                        <input type="text" name="mail" id="mail" value="" class="required email" />
                                </p>
                                <p>
                                        <label for="message" form="nice_contact"><?php _e( 'Your Message','nicethemes' ); ?><span class="required">*</span></label><br />
                                        <textarea name="message" id="message" class="required"></textarea>
                                </p>
                                <p>
                                        <input type="submit" value="<?php _e( 'Send Message', 'nicethemes' ); ?>" />
                                </p>
                        </form>

                        <div id="node"></div>
                        <div id="success"><?php _e( 'Thank you for leaving a message.', 'nicethemes' ); ?></div>

                </div>
            </article>

        <?php endwhile; ?>

    <?php else : ?>

        <header>
                <h2><?php _e( 'Not Found', 'nicethemes' ); ?></h2>
        </header>
        <p><?php _e( 'Sorry, but you are looking for something that isn\'t here.', 'nicethemes' ); ?></p>
        <?php get_search_form(); ?>

    <?php endif; ?>

    <!-- END #content -->
    </section>

<!-- END #container -->
</div>

<?php get_footer(); ?>